package com.nowcoder.community.service;

import com.nowcoder.community.entity.LoginTicket;
import com.nowcoder.community.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nowcoder.community.util.CommunityConstant;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 朱哥
 * @since 2025-02-13
 */
public interface IUserService extends IService<User>, CommunityConstant {

    Map<String, Object> register(User user);

    int activation(int userId, String code);

    Map<String,Object> login(String username,String password,int expiredSeconds);

    LoginTicket findLoginTicket(String ticket);

    int updateHeader(int id, String headerUrl);

    void logout(String ticket);

    User findUserById(int userId);

    User findUserByName(String toName);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);
}
